<?php
class Pageley_Util_StringTests extends Pageley_Test_Case {
	public function testStartsWith() {
		$this->assertTrue(Pageley_Util_String::startsWith("foobar", "foo"));
		$this->assertFalse(Pageley_Util_String::startsWith("foobar", "bar"));
	}
	
	public function testEndsWith() {
		$this->assertFalse(Pageley_Util_String::endsWith("foobar", "foo"));
		$this->assertTrue(Pageley_Util_String::endsWith("foobar", "bar"));
	}
	
	public function testSubstring() {
		$this->assertEquals("ob", Pageley_Util_String::substring("foobar", 2, 2));
		$this->assertEquals("bar", Pageley_Util_String::substring("foobar", 3));
		$this->assertEquals("foo", Pageley_Util_String::substring("foobar", 0, 3));
	}
	
	public function testLength() {
		$this->assertEquals(3, Pageley_Util_String::length("foo"));
	}
	
	public function testContains() {
		$this->assertTrue(Pageley_Util_String::contains("foobar", "foo"));
		$this->assertFalse(Pageley_Util_String::contains("bar", "foo"));
	}
}